package com.truyentranh.data;

import com.truyentranh.utils.AppSettingParams;
import com.truyentranh.utils.Logger;
import com.truyentranh.utils.StringUtils;

public class HaiBLMetalData {
	
	private String TYPE = "";
	
	//a link to image
	public static final String SRC = "src";
	public static final String BIG_SRC = "bigsrc";
	
	//a link to detail (comment, like of image page)	
	public static final String IMG = "img";
	
	//title to show in description
	public static final String TITLE = "title";
	
	public static final String UPLOADER = "uploader";
	public static final String VIEW_COUNT = "view";
	public static final String COMMENT_COUNT = "comment";
	public static final String LIKE_COUNT = "like";
	public static final String VIDEO = "video";
	public static final String VIDEO_LINK = "videoLink";
	
	private String imageUrl = "";
	private String detailUrl = "";
	private String titleDescription = "";
	private String uploaderName = "";
	private String viewerCount = "";
	private String commentCount = "";
	private String likeCount = "";
	private boolean isVideo = false;
	private String videoLink = "";
	private String bigImageUrl = "";
	private boolean hasMore = false;
	
	public HaiBLMetalData() {
		// TODO Auto-generated constructor stub
	}
	
	public String getId() {
		if (imageUrl != null && !"".equals(imageUrl)) {
			return StringUtils.MD5(imageUrl);
		} else if (detailUrl != null && !"".equals(detailUrl)) {
			return StringUtils.MD5(detailUrl);
		}
		return "-1";
	}
	
	
	public HaiBLMetalData(String imageUrl,String detailUrl, String title,
			String uploader, String viewCount, String commentCount){
		this.imageUrl = imageUrl;
		this.detailUrl = detailUrl;
		this.titleDescription = title;
		this.uploaderName = uploader;
		this.viewerCount = viewCount;
		this.commentCount = commentCount;
	}
	
	
	public String getImageUrl() {
		if(bigImageUrl != null 
				&& !"".equals(bigImageUrl)
				&& AppSettingParams.isUseBigImage()){
			return bigImageUrl;
		}
		return imageUrl;
	}
	public void setImageUrl(String imageUrl) {
		this.imageUrl = imageUrl;
	}
	
	public String getDetailUrl() {
		return detailUrl;
	}
	public void setDetailUrl(String detailUrl) {
		this.detailUrl = detailUrl;
	}
	public String getTitleDescription() {
		return titleDescription;
	}
	public void setTitleDescription(String titleDescription) {
		this.titleDescription = titleDescription;
	}
	public String getUploaderName() {
		return uploaderName;
	}
	public void setUploaderName(String uploaderName) {
		this.uploaderName = uploaderName;
	}
	public String getViewerCount() {
		return viewerCount;
	}
	public void setViewerCount(String viewerCount) {
		this.viewerCount = viewerCount;
	}
	public String getCommentCount() {
		if(commentCount != null && "0".equals(commentCount)) commentCount= "";
		return commentCount;
	}
	public void setCommentCount(String commentCount) {
		this.commentCount = commentCount;
	}

	public String getLikeCount() {
		return likeCount;
	}

	public void setLikeCount(String likeCount) {
		this.likeCount = likeCount;
	}

	public String getTYPE() {
		return TYPE;
	}

	public void setTYPE(String tYPE) {
		TYPE = tYPE;
	}

	public boolean isVideo() {
		return isVideo;
	}

	public void setVideo(boolean isVideo) {
		this.isVideo = isVideo;
	}

	public String getVideoLink() {
		return videoLink;
	}

	public void setVideoLink(String videoLink) {
		this.videoLink = videoLink;
	}

	/**
	 * @return the bigImageUrl
	 */
	public String getBigImageUrl() {
		return bigImageUrl;
	}

	/**
	 * @param bigImageUrl the bigImageUrl to set
	 */
	public void setBigImageUrl(String bigImageUrl) {
		this.bigImageUrl = bigImageUrl;
	}

	public boolean isHasMore() {
		return hasMore;
	}

	public void setHasMore(boolean hasMore) {
		this.hasMore = hasMore;
	}
	
	
	
	
	
	
	
	
	
	
}
